package tongcheng.com.tongcheng.utils;

import android.os.CountDownTimer;
import android.widget.TextView;

public class TimeCount extends CountDownTimer {

    public TextView mTextview;

        public TimeCount(long millisInFuture, long countDownInterval,TextView view) {
            super(millisInFuture, countDownInterval);
            mTextview = view;
        }



        @Override
        public void onTick(long millisUntilFinished) {// 计时过程
            mTextview.setClickable(false);//防止重复点击
            mTextview.setText(millisUntilFinished / 1000 + "S");
        }

    @Override
    public void onFinish() {
        mTextview.setClickable(true);//防止重复点击
        mTextview.setText("重新发送");
    }
}